<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>购买金豆</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="format-detection" content="telephone=no"/>
<meta name="format-detection" content="email=no"/>
<meta name="format-detection" content="address=no"/>
<link href="__PUBLIC__/css/base.css" rel="stylesheet"/>
</head>
<body class="huibg">
<!---  头部开始  -->
<div class="top clearfix">
	<div class="icon_left"></div>
	<div class="icon_right"></div>
</div>
<!---  头部结束  -->
<div class="buy_jd cssss">
	<div class="box">
		<a class="left">购买金豆：<span class="now_num2">100</span>个</a>
		<a class="right">
			<i class="btn9"></i>
			<input type="text" class="input2" value="100" readonly="readonly">
			<i class="btn10"></i>
		</a>
	</div>
	<div class="text">购买金豆个数为100的整数倍</div>
	<div class="accounts_box">
		<span>合计：</span>
		<span class="money">￥<em class="pay_money">1</em>.00</span>
		<a class="account">结算</a>
	</div>
</div>
<!---  确定 结算 提示框开始  -->
<div class="reminder_box buy_box none">
	<div class="reminderBox_bg"></div>
	<div class="reminderBox_text">
	</div>
</div>
<!---  确定 结算 提示框结束  -->
</body>
<script src="__PUBLIC__/js/jquery.js"></script>
<script src="__PUBLIC__/js/comm.js"></script>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
var now_num=100;
var now_num2=100;
var pay_money=1;
var detail=[{}];
var id={$id};
var nonceStr = '{$nonceStr}';
var timestamp = {$timestamp};
var signature = '{$signature}';

//减
$(".btn9").click(function(){
	if(now_num<=100){
		alert("至少购买100个金豆");
		return;
	}
	now_num-=100;
	now_num2-=100;
	pay_money-=1;
	$(".input2").val(now_num);
	$(".now_num2").html(now_num2);
	$(".pay_money").html(pay_money);
});
//加
$(".btn10").click(function(){
	now_num+=100;
	now_num2+=100;
	pay_money+=1;
	$(".input2").val(now_num);
	$(".now_num2").html(now_num2);
	$(".pay_money").html(pay_money);
});
//结算
$(".account").click(function(){
		detail=[{"id":id,"fee":pay_money,"points":0}];
		detail=JSON.stringify(detail);
		$.post('__URL__/wxPay',{
			nonceStr:nonceStr,
			timestamp:timestamp,
			signature:signature,
			paytype:6,
			detail:detail,
			totalfee:pay_money,
			points:0,
			tips: 'buyJd_box'
		},
		function(e){
			$(".buy_box").removeClass("none");
			$(".reminderBox_text").html(e)
		});
});

</script>

</html>